<template>
 <u-tabbar
    :value="value"
    @change="change"
    :fixed="true"
    :placeholder="true"
    :safeAreaInsetBottom="true"
	activeColor="#0F0F0F"
	inactiveColor="#A1A1A1"
    zIndex="9999"
  >
    <u-tabbar-item text="找工作">
		<image
			class="u-page__item__slot-icon"
			slot="inactive-icon"
			src="@/static/tabbar/zg1.svg"
		></image><image
			class="u-page__item__slot-icon"
			slot="active-icon"
			src="@/static/tabbar/zg2.svg"
		></image>
	</u-tabbar-item>
    <u-tabbar-item text="招工人">
		<image
			class="u-page__item__slot-icon"
			slot="inactive-icon"
			src="@/static/tabbar/zh1.svg"
		></image><image
			class="u-page__item__slot-icon"
			slot="active-icon"
			src="@/static/tabbar/zh2.svg"
		></image></u-tabbar-item>
    <u-tabbar-item text="我的消息"><image
			class="u-page__item__slot-icon"
			slot="inactive-icon"
			src="@/static/tabbar/msg1.svg"
		></image><image
			class="u-page__item__slot-icon"
			slot="active-icon"
			src="@/static/tabbar/msg22.png"
		></image></u-tabbar-item>
    <u-tabbar-item text="个人中心">
		<image
			class="u-page__item__slot-icon"
			slot="inactive-icon"
			src="@/static/tabbar/user1.svg"
		></image>
		<image
			class="u-page__item__slot-icon"
			slot="active-icon"
			src="@/static/tabbar/user22.png"
		></image>
	</u-tabbar-item>
  </u-tabbar>
</template>
<script>
export default {
  props: {
    value: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {};
  },
  methods: {
    change(e) {
      switch (e) {
        case 0:
          uni.switchTab({ url: "/pages/index/index" });
          break;
        case 1:
          uni.switchTab({ url: "/pages/worker/index" });
          break;
        case 2:
          uni.switchTab({ url: "/pages/message/index" });
          break;
        case 3:
		    // if(uni.getStorageSync('token')){
				uni.switchTab({ url: "/pages/user/index" });
			// }else{
			// 	uni.navigateTo({ url: "/pagesC/login/login" });
			// }
          break;
      }
    },
  },
};
</script>
<style>
	.u-page__item__slot-icon{ width: 40rpx; height: 40rpx;}
	.u-tabbar--fixed.data-v-542a922e {
		z-index: 9999;
	}
</style>